#include "studentloginsuccess.h"
#include "ui_studentloginsuccess.h"

StudentLoginSuccess::StudentLoginSuccess(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::StudentLoginSuccess)
{
    ui->setupUi(this);
    this->setWindowIcon(QIcon(":/img/student.jpg"));
    this->stuInfo = nullptr;
}

StudentLoginSuccess::~StudentLoginSuccess()
{
    delete ui;
}

void StudentLoginSuccess::getInfo(StudentInfo* s1)
{
    this->stuInfo = s1;
}

void StudentLoginSuccess::on_checkInfo_clicked()
{
    stuInfo->showAll();
    QString show = QString::fromStdString(stuInfo->toString());
//    cout << stuInfo->toString();
    ui->textBrowser->setText(show);
}

void StudentLoginSuccess::on_back2main_clicked()
{
    emit back2main();
    this->hide();
}

void StudentLoginSuccess::on_back2login_clicked()
{
    emit back2login();
    this->hide();
}

void StudentLoginSuccess::on_clearInfo_clicked()
{
    ui->textBrowser->clear();
}
